﻿using LeShiTao_Library.WeChat.Public_WC;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml;

namespace TB_WS.WeChat.LingYu
{
    public class SysInfo
    {
        public static XmlNode HB_List;
        public HongBao HB;

        public SysInfo(string XML_Path)
        {
            XmlDocument xml = new XmlDocument();
            xml.Load(XML_Path);
            HB_List = xml.SelectSingleNode("//WeChat_HongBao");

            HB = new HongBao(XML_VALUE("CERT_Path").ToString(),
                XML_VALUE("CERT_PWD").ToString(), XML_VALUE("KEY").ToString(),
                XML_VALUE("mch_id").ToString(), XML_VALUE("wxappid").ToString(),
                XML_VALUE("send_name").ToString(), XML_VALUE("client_ip").ToString(), 1,
                XML_VALUE("wishing").ToString(), XML_VALUE("act_name").ToString(),
                XML_VALUE("remark").ToString(), HongBao.RandomStr());
        }


        public string GET_Seller_Nick()
        {
            return XML_VALUE("Seller_Nick");
        }
        public string GET_WX_User()
        {
            return XML_VALUE("WX_User");
        }
        private string XML_VALUE(string KEY)
        {
            return HB_List[KEY].InnerText.ToString();
        }
    }
}
